package com.finance.system.test.threadlocal;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

@Configuration
public class ThreadConfiguration {

    @Bean
    public ThreadPoolExecutor initThreadPool(){
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
                1,
                10,
                1,
                TimeUnit.MINUTES,
                new LinkedBlockingQueue<Runnable>()
        );

        return threadPoolExecutor;
    }
}
